import 'package:flutter/material.dart';

class NoAppBarPage extends StatefulWidget {
  const NoAppBarPage({super.key});

  @override
  State<NoAppBarPage> createState() => _NoAppBarPageState();
}

class _NoAppBarPageState extends State<NoAppBarPage> {
  String message = "Hello";

  // MediaQuery.of(context).padding.top 在使用 appBar 时一直为0, 不使用 appBar 时才能取到值。
  @override
  Widget build(BuildContext context) {
    MediaQueryData data = MediaQuery.of(context);
    debugPrint("get MediaQueryData ${data.padding}");
    return Scaffold(
      body: Column(
        crossAxisAlignment: CrossAxisAlignment.center,
        children: [
          const BackButton(),
          Expanded(
            child: Text("MediaQuery.of(context).padding = ${data.padding}"),
          ),
        ],
      ),
    );
  }
}
